package gui.table;

import java.awt.Component;

import javax.swing.AbstractCellEditor;
import javax.swing.JComboBox;
import javax.swing.JTable;
import javax.swing.table.TableCellEditor;

/**
 * @author Ann Raboschuk
 *
 */
@SuppressWarnings("serial")
public class CustomTableCellEditor extends AbstractCellEditor implements TableCellEditor
{      
   private JComboBox box;
   
   @Override
   public Component getTableCellEditorComponent(JTable table, Object value,
         boolean isSelected, int row, int column)
   {
      box = (JComboBox) value;
      return (JComboBox) value;
   }

   @Override
   public Object getCellEditorValue()
   {
      return box.getSelectedItem();
   }
}
